const app = {
  state: {
    sidebar: {
      collapsed: localStorage.getItem('sidebar-collapsed') || false,
    },
  },
  mutations: {
    TOGGLE_SIDEBAR: (state: any) => {
      state.sidebar.collapsed = !state.sidebar.collapsed;
      localStorage.setItem('sidebar-collapsed', state.sidebar.collapsed);
    },
  },
  actions: {
    ToggleSidebar: ({ commit }: any) => {
      commit('TOGGLE_SIDEBAR');
    },
  },
};

export default app;
